/**
 * Copyright(c) 2014 Xunton Solutions
 *
 * History:
 *   15-9-18 下午5:43 Created by dwzhang
 */
package com.jade.bss.weixin.api.pay.protocol;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import com.jade.bss.weixin.api.protocol.xml.Request;

/**
 * 当交易发生之后一段时间内，由于买家或者卖家的原因需要退款时，卖家可以通过退款接口将支付款退还给买家，微信支付将
 * 在收到退款请求并且验证成功之后，按照退款规则将支付款按原路退到买家帐号上。
 * 注意：
 * 1、交易时间超过一年的订单无法提交退款；
 * 2、微信支付退款支持单笔交易分多次退款，多次退款需要提交原支付订单的商户订单号和设置不同的退款单号。一笔退款失败
 * 后重新提交，要采用原来的退款单号。总退款金额不能超过用户实际支付金额。
 *
 * @author <a href="mailto:dwzhang@xunton.com">dwzhang</a> 
 * @version 1.0 15-9-18 下午5:43
 */
@XmlRootElement (name = "xml")
@XmlAccessorType (XmlAccessType.FIELD)
public class RefundRequest extends Request
{
    //微信生成的订单号，在支付通知中有返回
    @XmlElement (name = "transaction_id")
    private String transactionId;
    //商户侧传给微信的订单号
    @XmlElement (name = "out_trade_no")
    private String outOrderNo;
    //商户系统内部的退款单号，商户系统内部唯一，同一退款单号多次请求只退一笔
    @XmlElement (name = "out_refund_no")
    private String outRefundNo;
    //订单总金额，单位为分，只能为整数
    @XmlElement (name = "total_fee")
    private int totalFee;
    //退款总金额，订单总金额，单位为分，只能为整数
    @XmlElement (name = "refund_fee")
    private int refundFee;
    //货币类型
    @XmlElement (name = "refund_fee_type")
    private String refundFeeType;
    //操作员帐号, 默认为商户号
    @XmlElement (name = "op_user_id")
    private String opUserId;

    public String getTransactionId()
    {
        return transactionId;
    }

    public void setTransactionId(String transactionId)
    {
        this.transactionId = transactionId;
        putParam("transaction_id", transactionId);
    }

    public String getOutOrderNo()
    {
        return outOrderNo;
    }

    public void setOutOrderNo(String outOrderNo)
    {
        this.outOrderNo = outOrderNo;
        putParam("out_trade_no", outOrderNo);
    }

    public String getOutRefundNo()
    {
        return outRefundNo;
    }

    public void setOutRefundNo(String outRefundNo)
    {
        this.outRefundNo = outRefundNo;
        putParam("out_refund_no", outRefundNo);

    }

    public int getTotalFee()
    {
        return totalFee;
    }

    public void setTotalFee(int totalFee)
    {
        this.totalFee = totalFee;
        putParam("total_fee", totalFee);

    }

    public int getRefundFee()
    {
        return refundFee;
    }

    public void setRefundFee(int refundFee)
    {
        this.refundFee = refundFee;
        putParam("refund_fee", refundFee);

    }

    public String getRefundFeeType()
    {
        return refundFeeType;
    }

    public void setRefundFeeType(String refundFeeType)
    {
        this.refundFeeType = refundFeeType;
        putParam("refund_fee_type", refundFeeType);

    }

    public String getOpUserId()
    {
        return opUserId;
    }

    public void setOpUserId(String opUserId)
    {
        this.opUserId = opUserId;
        putParam("op_user_id", opUserId);

    }
}
